<?php
/**
 * 内核功能
 * @version 1.0.0-beta.220303
 */
include 'api/common.php';
$serverInfo = [
    ['text' => '操作系统', 'minValue' => '不限制', 'recommendValue' => 'Linux', 'value' => PHP_OS, 'comment' => ''],
    ['text' => 'PHP版本', 'minValue' => '8.0', 'recommendValue' => '8.1', 'value' => PHP_VERSION, 'comment' => '使用路由注解需要最低PHP8.0'],
    ['text' => 'MySQL版本', 'minValue' => '8.0', 'recommendValue' => '8.0', 'value' => '-', 'comment' => '无法获取：未配置数据库连接信息'],
    ['text' => '附件上传', 'minValue' => '2M', 'recommendValue' => '2M', 'value' => checkCfgVar('upload_max_filesize'), 'comment' => ''],
    ['text' => 'GD库版本', 'minValue' => '2.0', 'recommendValue' => '2.1', 'value' => GD_VERSION, 'comment' => ''],
    ['text' => '磁盘空间', 'minValue' => '100MB', 'recommendValue' => '不限制', 'value' => CommonUtils::formatBytes(@disk_free_space(".")), 'comment' => ''],
];
$extInfo = [
    ['text' => 'CURL', 'result' => '', 'comment' => ''],
    ['text' => 'OpenSSL', 'result' => '', 'comment' => ''],
    ['text' => 'PDO Mysql', 'result' => '', 'comment' => ''],
    ['text' => 'GD', 'result' => '', 'comment' => ''],
    ['text' => 'mbstring', 'result' => '', 'comment' => ''],
    ['text' => 'SimpleXML', 'result' => '', 'comment' => ''],
];
$fnInfo = [
    ['text' => 'curl_init()', 'result' => '', 'comment' => ''],
    ['text' => 'chmod()', 'result' => '', 'comment' => ''],
    ['text' => 'mb_substr()', 'result' => '', 'comment' => ''],
    ['text' => 'simplexml_load_string()', 'result' => '', 'comment' => ''],
];
$fsInfo=[
    ['text'=>'/.env','result'=>'','comment'=>''],
    ['text'=>'/public/uploads/','result'=>'','comment'=>''],
    ['text'=>'/runtime','result'=>'','comment'=>''],
];
$data = [
    'serverInfo' => $serverInfo,
    'extInfo' => $extInfo,
    'fnInfo' => $fnInfo,
];
echo json_encode($data, JSON_UNESCAPED_UNICODE);
phpinfo();
